package wge

import (
	"fmt"
)

// 异常处理，在这里打印出异常

func Recovery(c *Context) Stringer {
	defer func() {
		if err := recover(); err != nil {
			logger.Println(err)
			
			fmt.Fprint(c.w, Err(error_serverwrong, "Server Error"))
		}
	}()
	
	c.Next()
	
	return nil
}
